package thinkingInJava.arrays;

//: arrays/RaggedArray.java
import java.util.*;

public class RaggedArray {
public static void main(String[] args) {
  Random rand = new Random(47);
  // 3-D array with varied-length vectors:
  int[][][] a = new int[rand.nextInt(7)][][];
  for(int i = 0; i < a.length; i++) {
    a[i] = new int[rand.nextInt(5)][];
    for(int j = 0; j < a[i].length; j++)
      a[i][j] = new int[rand.nextInt(5)];
  }
  System.out.println(Arrays.deepToString(a));
  //System.out.println(Arrays.toString(a)); // [[[I@4e25154f, [[I@70dea4e, [[I@5c647e05, [[I@33909752, [[I@55f96302, [[I@3d4eac69]
}
} /* Output:
[[], [[0], [0], [0, 0, 0, 0]], [[], [0, 0], [0, 0]], [[0, 0, 0], [0], [0, 0, 0, 0]], [[0, 0, 0], [0, 0, 0], [0], []], [[0], [], [0]]]
*///:~
